package hou.just4fun.SeekGirlFriend.model;

import hou.just4fun.SeekGirlFriend.util.Satisfied;

/**
 * @author houweitao
 * @date 2016年5月13日下午2:56:55
 */

public class Couple {
	private Person husband;
	private Person wife;
	private double stability;

	public Couple(Person a, Person b) {
		husband = a;
		wife = b;
		// TODO 之后可以和夫妻的属性挂钩
		stability = Math.random();
	}

	@Override
	public int hashCode() {
		return husband.hashCode() + wife.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Couple) {
			if (((Couple) obj).getHusband().equals(husband))
				return true;
		}
		return false;
	}

	@Override
	public String toString() {
		String add = "";
		// add = add + "当前老婆得分：" +
		// husband.getLoverScoreMap().get(wife.getName()) + " ; " +
		// husband.getAcknowledge();

		return "[Husband:" + husband.getName() + "rank:" + Satisfied.rank(husband) + "/"
				+ husband.getAcknowledge().size() + ", Wife:" + wife.getName() + " rank:" + Satisfied.rank(wife) + "/"
				+ wife.getAcknowledge().size() + "]";
	}

	public Person getHusband() {
		return husband;
	}

	public void setHusband(Person husband) {
		this.husband = husband;
	}

	public Person getWife() {
		return wife;
	}

	public void setWife(Person wife) {
		this.wife = wife;
	}

	public double getStability() {
		return stability;
	}

	public void setStability(double stability) {
		this.stability = stability;
	}
}
